package com.credithc.eagleeye.demo.rabbitmq;
import com.credithc.eagleeye.demo.config.RabbitMqConfig;
import com.credithc.eagleeye.demo.service.DemoService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
 * 描 述: <br/>
 * 作 者: zhangjin<br/>
 * 创 建：2019年10月23日<br/>
 * 版 本：v1.0.0<br>
 * <p>
 * 历 史: (版本) 作者 时间 注释 <br/>
 */
@Component
public class Topic1Consumer {
    @Autowired
    private DemoService demoService;
    @RabbitListener(queues = RabbitMqConfig.TOPIC_QUEUE1)
    public void process(String hello) throws InterruptedException {
        Thread.sleep(2000);
        demoService.queryUser(1, 1);
        System.out.println("Receiver : " + hello);
    }
}
